package com.ggs.rg.ybjb.usermodule.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ggs.rg.ybjb.pojomodule.pojo.TOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * @author cxw
 * @since 2021-11-02
 */
@Mapper
public interface TOrderMapper extends BaseMapper<TOrder> {

    public List<HashMap<String,Object>> selectOrdersInfo(@Param("oid") String oid);

    //根据手机号获取已付款订单
    public IPage<TOrder> selectOrderByPhone(Page<TOrder> page,
                                            @Param(Constants.WRAPPER) QueryWrapper wrapper,
                                            @Param("phone") String phone);

    //根据手机号获取未付款订单
    public IPage<TOrder> selectUnpaidOrderByPhone(Page<TOrder> page,
                                            @Param(Constants.WRAPPER) QueryWrapper wrapper,
                                            @Param("phone") String phone);

    //根据手机号获取oid
    public List<Long> selectTOrderByPhone(String phone);

}
